package com.guigu.www.cxk.controller;

import com.guigu.www.cxk.service.CXKBespeakResultService;
import com.guigu.www.pojo.Bespeak;
import com.guigu.www.pojo.BespeakResult;
import com.guigu.www.pojo.PersonClassification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/bespeakresult")
public class CXKBespeakResultController {
    @Autowired
    CXKBespeakResultService service;

    /*查询体检预约表*/
    @PostMapping
    @ResponseBody
    public List<Bespeak> SelectBespeak(int id){
         return service.selectBespeak(id);
    }

    /*根据体检用户的id查询体检结果*/
    @PostMapping("/Bespeakrest/{id}")
    @ResponseBody
    public BespeakResult Bespeakrest(@PathVariable int id){
        return service.selectByIdResult(id);
    }

    /*查询人群分类*/
    @PostMapping("/personclassification")
    @ResponseBody
    public List<PersonClassification> personclassification(){
        return service.selectClassifica();
    }
}
